﻿using System.Windows;
using System.Windows.Controls;
using Crusades.MapView;

namespace Crusades {
	public partial class MapManipulator {
		#region DependencyPropertyTrash
		public static readonly DependencyProperty MapProperty =
			DependencyProperty.Register(
				"Map", typeof(IMap),
				typeof(MapManipulator), null
				);
		#endregion //DependencyPropertyTrash

		public MapManipulator() {
			InitializeComponent();
			MouseWheel += MapManipulator_MouseWheel;
			controller = new MapManipulatorController(Map);
		}

		private int zoom=1;
		private MapManipulatorController controller;

		void MapManipulator_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) {
			controller.MapManipulator_MouseWheel(e.Delta);
		}

		public IMap Map {
			get { return (IMap)GetValue(MapProperty); }
			set {
				SetValue(MapProperty, value);
				Content = (UserControl)value;
			}
		}


	}
}
